<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<link href="css/zTreeStyle/zTreeStyle.css" rel="stylesheet" type="text/css">					<!-- zTree CSS函式庫 -->
<link href="css/redmond/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" type="text/css">	<!-- jquery UI CSS函式庫 -->
<link href="css/selfTemplate.css" rel="stylesheet" type="text/css">							<!-- 自建CSS函式庫 -->

<script src="js/jquery-1.10.2.min.js" type="text/javascript"></script>								<!-- jquery 函式庫 -->
<script src="js/jquery-ui-1.10.3.custom.js" type="text/javascript"></script>					<!-- jquery UI 函式庫 -->
<script src="js/jquery.cookie.js" type="text/javascript"></script>								<!-- 操做cookie用 -->
<script src="js/widgets.js" type="text/javascript"></script>									<!-- 自建函式庫 -->


<style type="text/css">
	div#mainDiv {
		width: 80%; 
		padding-top:20px;
		padding-buttom:20px; 
		padding-right:20px;
		padding-left:15px; 
		
	}
</style>

<script type="text/javascript">


$(document).ready(function(){
	
	init("QEDP.html");
	
	
	$("#btnSubmit").bind("click", function(){
		clearErrorMsg();
	 	windowFreeze();
		$.ajax({ type:'post',url:"QueryEmpDepRecord",dataType:'json',async:false,
			success : function(reses) {
				if ( reses.length > 0 ) {
					$("#queResRoot").html("<table id='tableQueryEmpDepRecord'><thead class='tableFirst'><tr><th>年</th><th>月份</th><th>執行人</th><th>執行次數</th></tr><tbody id='tbodyQueryEmpDepRecord'></tbody></table>");
					
					
					$.each(reses, function(i,res) {
						var tmp = "<tr><td class='int'>"+res.s1+"</td><td class='int'>"+res.s2+"</td><td class='zhTwN'>"+res.s3+"</td><td class='int'>"+res.s4+"</td></tr>";
						$("#tbodyQueryEmpDepRecord").append(tmp);
					});
					
					refreshUI(1,"tbodyQueryEmpDepRecord",false);
					
				} else {
					/* $("#queResRoot").html("");
					$("#errShortMsg").html("沒有查詢到結果"); */
				}
			}, error : function(xhr, ajaxOptions, thrownError) { errorAjx(xhr); }
		});
		 
		 $.ajax({ type:'post',url:"QueryVincent",dataType:'json',async:false,
				success : function(reses) {
					if ( reses.length > 0 ) {
						$("#queResPerRoot").html("<table id='tableQueryVincent'><thead class='tableFirst'><tr><th>年</th><th>月份</th><th>部署總數</th><th>執行次數</th></tr><tbody id='tbodyQueryVincent'></tbody></table>");
						
						
						$.each(reses, function(i,res) {
							var tmp = "<tr><td class='int'>"+res.s1+"</td><td class='int'>"+res.s2+"</td><td class='int'>"+res.s3+"</td><td class='int'>"+res.s4+"</td></tr>";
							$("#tbodyQueryVincent").append(tmp);
						});
						
						refreshUI(1,"tbodyQueryVincent",false);
						
					} else {
						/* $("#queResRoot").html("");
						$("#errShortMsg").html("沒有查詢到結果"); */
					}
				}, error : function(xhr, ajaxOptions, thrownError) { errorAjx(xhr); }
			});
 		windowUnfreeze();
	});
	
	$("button").button();
});

</script>
</head>
<body>
	<div id="header"></div>		<!-- 畫面抬頭 -->

	<div id="mainDiv" >
		<table id="tableQueryCriDepMemphis">
			<thead class="tableFirst">
				<!-- <tr><th class="right">預設查詢天數</th><td><input size="2" class="int" value="15" type="text" id="queryInterval" />天內</td></tr> -->
				<tr><td class="center" colspan="2"><button id="btnSubmit" type="button">送出</button></td></tr>
				<tr><td colspan="2">&nbsp;</td></tr>
			</thead>
		</table>
		<p>
		<div id="queResRoot"></div>
		<p><p> 
		<div id="queResPerRoot"></div>
	</div>
	<p><p>
</body>
</html>